package cn.heyige.backend.dto;

import java.time.LocalDateTime;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

@Data
public class ShareDto {
    
    @Setter
    @Getter
    public static class CreateShareRequest {
        @NotNull(message = "会话ID不能为空")
        private Long sessionId;
        
        @NotBlank(message = "标题不能为空")
        private String title;
        
        private String description;
        
        private ShareType shareType = ShareType.PUBLIC;
        
        private Integer rewardQuota = 0;
        
        private Integer maxViewCount;
        
        private LocalDateTime expireTime;
    }
    
    @Setter
    @Getter
    public static class UpdateShareRequest {
        private String title;
        
        private String description;
        
        private LocalDateTime expireTime;
        
        private Integer maxViewCount;
        
        private Integer rewardQuota;
    }
    
    @Setter
    @Getter
    public static class ShareResponse {
        private Integer id;
        private Integer userId;
        private Integer sessionId;
        private String shareCode;
        private String title;
        private String description;
        private ShareType shareType;
        private Integer rewardQuota;
        private Integer maxViewCount;
        private Integer viewCount;
        private Boolean isActive;
        private LocalDateTime expireTime;
        private LocalDateTime createdAt;

    }
    
    public enum ShareType {
        PUBLIC, PRIVATE, PASSWORD
    }
}